package com.mebs.edi.model.edi.e211;

import javax.persistence.Column;
import javax.persistence.Embeddable;

import com.mebs.edi.model.dom.DomAttribute;
import com.mebs.edi.model.dom.DomEntity;

/**
 * 
 * B2A section of a 211 EDI file 
 * 
 * @author nit
 *
 */
@Embeddable
@DomEntity(name = "B2A")
public class Edi211B2a {
	
	@Column(nullable = true, length = 2)
	@DomAttribute
	private String b2a01; 		// Transaction set Purpose Code
	
	public Edi211B2a() {
		super();
	}
	
	public String getB2a01() {
		return b2a01;
	}

	public void setB2a01(String b2a01) {
		this.b2a01 = b2a01;
	}

	@Override
	public String toString() {
		return "Edi211B2a [b2a01=" + b2a01 + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((b2a01 == null) ? 0 : b2a01.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Edi211B2a other = (Edi211B2a) obj;
		if (b2a01 == null) {
			if (other.b2a01 != null)
				return false;
		} else if (!b2a01.equals(other.b2a01))
			return false;
		return true;
	}
}
